using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class PopUpManager : MonoBehaviour{
	
	public static PopUpManager instance = null;
	public List<GameObject> popUpMenus;
	//private GameObject activePopUp;
	private Dictionary<POPUP_MENUS, GameObject> menus;
	
	void Awake(){
		instance = this;
		menus = new Dictionary<POPUP_MENUS, GameObject>();
		menus.Add(POPUP_MENUS.GAMEOVER,GameObject.Instantiate
			(popUpMenus[(int)POPUP_MENUS.GAMEOVER] ) as GameObject);
		menus.Add(POPUP_MENUS.PAUSE,GameObject.Instantiate
			(popUpMenus[(int)POPUP_MENUS.PAUSE] ) as GameObject);
		foreach(KeyValuePair<POPUP_MENUS, GameObject> menu in menus){
			menu.Value.SetActive(false);	
		}
	}

	public enum POPUP_MENUS{
		GAMEOVER = 0,
		PAUSE = 1
	}
	
	public void ShowMenu(bool active, POPUP_MENUS menuName){
        menus[menuName].SetActive(active);
	}
}
